<template>
	<view class="container" >
		<view class="goods-list">
			<view class="item" v-for="(item, index) in goodsData" :key="index">
				<goods-number :itemList="item"></goods-number>
			</view>
			<uni-load-more :status="pageParams.isMore" />
		</view>
	</view>
</template>

<script>

export default {
	data() {
		return {
			goodsData:[],
			dataLists:[
				{
					customerName:'电厂客户1号',
					driver:'张三',
					phone: '1802888182',
					queueStatus: 90000,
					queueStatusName: '已完成'
				},
				{
					customerName:'电厂客户2号',
					driver:'李四',
					phone: '1802888182',
					queueStatus: 40000,
					queueStatusName: '待审核'
				},
				{
					customerName:'电厂客户3号',
					driver:'王五',
					phone: '1802888182',
					queueStatus: 40010,
					queueStatusName: '进行中'
				}
			],
			titleLists:[
				{
					id:1,
					text:'待审核',
					checked: true,
				},
				{
					id:2,
					text:'进行中',
					checked: false,
				},
				{
					id:3,
					text:'已完成',
					checked: false,
				}
			]
		}
	},
	methods: {
		clickItem(id){
			this.titleLists.forEach(item=>{
				item.checked = false
				if(item.id == id) item.checked = true
			})
			this.goodsData = this.dataLists.filter(item=>{
				if(id == 1){
					return item.queueStatus == 40000
				}else if(id == 2){
					return item.queueStatus < 90000 && item.queueStatus > 40000
				}else{
					return item.queueStatus == 90000
				}
			})
		}
	},
	onPullDownRefresh() {
		
	},
	onShow() {
		// this.goodsData = this.dataLists.filter(item=>{
		// 	return item.queueStatus == 40000
		// })
		console.log(this.goodsData,'这是货物列表')
	}
};
</script>

<style lang="scss" scoped>
	.container{
		padding: 20rpx;
	}
	.example-body{
		display: flex;
		height: 40px;
		line-height: 40px;
		text-align: center;
		border-bottom: 1px solid #409eff;
		border-top: 1px solid #409eff;
		border-left: 1px solid #409eff;
		margin-bottom: 10rpx;
		.tag-view{
			flex: 1;
			cursor: pointer;
			border-right: 1px solid #409eff;
			color: #409eff;
			background: #fff;
		}
		.tag-view.active,.tag-view:hover{
			background: #409eff;
			color: #fff;
		}
	}
</style>
